package web.study.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

public class DisplayBodyTag extends TagSupport
{
    /**
     * 序列化
     */
    private static final long serialVersionUID = 1L;
    
    @Override
    public int doStartTag()
        throws JspException
    {
        // 获得body请求参数的值 
        String body = pageContext.getRequest().getParameter("body");
        if (null == body)
        {
            return super.doStartTag();
        }
        else
        {
            return Tag.EVAL_BODY_INCLUDE;
        }
    }
}
